﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace TestMatrix.Phone.JumpList
{
    public partial class GIF : PhoneApplicationPage
    {
        ObservableCollection<BitmapImage> bmList;

        public GIF()
        {
            InitializeComponent();

            InitList();

            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
        }

        private void CompositionTarget_Rendering(object sender, EventArgs e)
        {
            for (int i = 0; i < bmList.Count; i++)
            {

                this.imgViewer.Source = bmList[i];

                
                //this.imgViewer.Width = this.imgViewer.Source.Width;

                //this.imgViewer.Height = this.imgViewer.Source.Height;

            }
        }

        public void InitList()
        {

            bmList = new ObservableCollection<BitmapImage>();

            for (int i = 1; i < 15; i++)
            {
                //BitmapImage bmImg = new BitmapImage(new Uri(@"Images\IMG0000" + i.ToString() + ".bmp"),UriKind.Relative);
                BitmapImage bmImg = new BitmapImage(new Uri("E:\\Work\\Windows Phone\\TestMatrix\\TestMatrix.Phone\\TestMatrix.Phone\\JumpList\\Images\\IMG0000" + i.ToString() + ".bmp"));
                
                bmList.Add(bmImg);


            }

        }
    }
}